import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: Lily
 * Date: 2024-09-23
 * Time: 19:23
 */
public class test_1 {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        // 注意 hasNext 和 hasNextLine 的区别
        while (in.hasNext()) { // 注意 while 处理多个 case
            float kg = in.nextFloat();
            String b = in.next();
            int num=0;

            if (kg > 0) {
                num += 20;
                if (kg > 1) {
                    num += (int) Math.ceil(kg-1);
                }
            }
            if (b.equals("y")){
                num+=5;
            }

            System.out.println(num);
        }
    }
}
